package com.zwz.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName tourism_info
 */
@Data
public class TourismInfo implements Serializable {
    /**
     * 旅游信息id
     */
    @TableId(value = "tourism_id", type = IdType.AUTO)
    private Integer tourismId;

    /**
     * 旅游地
     */
    private String tourismAddress;

    /**
     * 旅游文章标题
     */
    private String tourismTitle;

    /**
     * 旅游文章内容
     */
    private String tourismContents;

    /**
     * 文章作者
     */
    private String tourismAuthor;

    /**
     * 编写时间
     */
    private Date createTime;

    /**
     * 最后修改时间
     */
    private Date lastEditTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TourismInfo other = (TourismInfo) that;
        return (this.getTourismId() == null ? other.getTourismId() == null : this.getTourismId().equals(other.getTourismId()))
                && (this.getTourismAddress() == null ? other.getTourismAddress() == null : this.getTourismAddress().equals(other.getTourismAddress()))
                && (this.getTourismTitle() == null ? other.getTourismTitle() == null : this.getTourismTitle().equals(other.getTourismTitle()))
                && (this.getTourismContents() == null ? other.getTourismContents() == null : this.getTourismContents().equals(other.getTourismContents()))
                && (this.getTourismAuthor() == null ? other.getTourismAuthor() == null : this.getTourismAuthor().equals(other.getTourismAuthor()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getLastEditTime() == null ? other.getLastEditTime() == null : this.getLastEditTime().equals(other.getLastEditTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTourismId() == null) ? 0 : getTourismId().hashCode());
        result = prime * result + ((getTourismAddress() == null) ? 0 : getTourismAddress().hashCode());
        result = prime * result + ((getTourismTitle() == null) ? 0 : getTourismTitle().hashCode());
        result = prime * result + ((getTourismContents() == null) ? 0 : getTourismContents().hashCode());
        result = prime * result + ((getTourismAuthor() == null) ? 0 : getTourismAuthor().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getLastEditTime() == null) ? 0 : getLastEditTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", tourismId=").append(tourismId);
        sb.append(", tourismAddress=").append(tourismAddress);
        sb.append(", tourismTitle=").append(tourismTitle);
        sb.append(", tourismContents=").append(tourismContents);
        sb.append(", tourismAuthor=").append(tourismAuthor);
        sb.append(", createTime=").append(createTime);
        sb.append(", lastEditTime=").append(lastEditTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}